package com.liuzy.openapi;

import com.liuzy.tool.HTTP;

/**
 * 聚合API
 * @author liuzy
 * @since 2015年10月18日
 */
public class JuheApi {
	public static void main(String[] args) {
		System.out.println(getWether("衡山"));
	}
	public static String openId = "JHad136b87d7fa83f698433f8bb297cb82";
	/** 天气预报 */
	public static String getWether(String cityname) {
		HTTP client = new HTTP();
		String url = "http://v.juhe.cn/weather/index";
		client.put2url("cityname", cityname).put2url("key", "125bf6537cf00c77df78a32c0f982745");
		String jsonString = client.doGET(url);
		return jsonString;
	}
	/** 二维码生成 */
	public static String getQrcode(String text) {
		HTTP client = new HTTP();
		String url = "http://liantu.api.juhe.cn/api.php";
		client.put2url("text", text).put2url("key", "4396764f11b2307622eba9f33d894043");
		String jsonString = client.doGET(url);
		return jsonString;
	}
	/** 违章城市查询 */
	public static String getCarWarn() {
		HTTP client = new HTTP();
		String url = "http://v.juhe.cn/wz/citys";
		client.put2url("key", "73d75486da3857439f945d2bd5cb024c");
		String jsonString = client.doGET(url);
		return jsonString;
	}
}
